﻿using Apollo.TokenUtils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace Apollo.AST
{
    /// <summary>
    /// 节点
    /// </summary>
    internal class Node
    {
        /// <summary>
        /// 节点类型
        /// </summary>
        public NodeTypeEnum NodeType    {  get; set;  }

       /// <summary>
       /// 节点内容
       /// </summary>
       public Token NodeToken { get; set; }
       
        /// <summary>
        /// 节点名称
        /// </summary>
        public string Name
        {
            get
            {
                return NodeType.ToString();
            }
        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        public Node(NodeTypeEnum nodeType = NodeTypeEnum.INTEGER)
        {
            NodeType = nodeType;
        }

        public override string ToString()
        {
            return $"Node: Type={NodeType}, Token={NodeToken}";
        }
    }



}
